package com.flu.holidays.properties;

import com.flu.holidays.constant.PropertiesConstant;
import lombok.*;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.bind.DefaultValue;
import org.springframework.stereotype.Component;

/**
 * 节假日服务数据源配置
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ConfigurationProperties(prefix = PropertiesConstant.PREFIX)
public class HolidayDataSourceProperties {

    /**
     * 节假日服务数据源类型
     */
    private DataSourceType type;


    @Getter
    public enum DataSourceType {
        /**
         * JSON文件数据源
         */
        JSON("json", "配置文件"),

        /**
         * 数据库数据源
         */
        DB("db", "数据库");

        private final String value;
        private final String description;

        DataSourceType(String value, String description) {
            this.value = value;
            this.description = description;
        }

    }

}
